<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<script type="text/javascript" src="js/dateTime.js"></script>

<script type="text/javascript"
	src="<%=path %>/My97DatePicker/WdatePicker.js"></script>

<title>添加工作包</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="/sbm/css/screen.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/sbm/ckeditor/ckeditor.js"></script>
<script language="javascript">
	function mycheck() {
		if (myform.title.value == "") {
			alert("工作包名称不能为空！！");
			myform.title.focus();
			return false;
		}
		
		if (myform.workamount.value == 0.0) {
			alert("请填写工作量");
			myform.workamount.focus();
			return false;
		}
		if (myform.progress.value > 100) {
			alert("工作进度不能大于100");
			myform.workamount.focus;
			return false;
		}
		if (myform.startdate.value == "") {
			if (confirm("工作包起始时间未定？")) {
				return true;
			} else {
				return false;
			}
		}
		if (myform.deadline.value == "") {
			if (confirm("工作包结束时间未定？")) {
				return true;
			} else {
				return false;
			}
		}
	}
</script>
</head>


<body>
	<s:form action="modifywork" method="post" enctype="multipart/form-data"
		name="myform">
		<table width="600px" align="center" class="class1">
			<tr>
				<td colspan="3" align="right"><span class="title">修改工作包</span>
				</td>
			</tr>
			<tr>
				<td width="10%">&nbsp;</td>
				<td>
					<table>
						<tr>
							<td width="25%" height="38">工作包名称</td>
							<td width="35%"><s:textfield name="work.title" id="title" />
								<s:hidden name="work.wpid" /></td>
						</tr>
						<tr>

							<td>&nbsp;&nbsp;&nbsp;工<br />&nbsp;&nbsp;&nbsp;作<br />&nbsp;&nbsp;&nbsp;包<br />&nbsp;&nbsp;&nbsp;描<br />&nbsp;&nbsp;&nbsp;述</td>
							<td width="100px" align="right"><s:textarea name="work.description" rows="15" 
									id="description" />
									<script type="text/javascript">
						CKEDITOR.replace('description');
						</script>
							</td>
						</tr>
						<tr>
							<td>工作包进度</td>
							<td><s:textfield name="work.progress" width="20px"
									id="progress" />%</td>
						</tr>
						<tr>
							<td>工作类型</td>
							<td><select name="work.type">
									<option value="0"
										<c:out value="${work.type == 0?'selected':''}" />>任务</option>
									<option value="1"
										<c:out value="${work.type == 1?'selected':''}" />>改进</option>
									<option value="2"
										<c:out value="${work.type == 2?'selected':''}" />>BUG</option>
									<option value="3"
										<c:out value="${work.type == 3?'selected':''}" />>讨论</option>
									<option value="4"
										<c:out value="${work.type == 4?'selected':''}" />>未定</option>
							</select>
							</td>
						</tr>
						<tr>
							<td>工作包级别</td>
							<td><select name="work.priority">
									<option value="0"
										<c:out value="${work.priority == 0?'selected':''}" />>紧急</option>
									<option value="1"
										<c:out value="${work.priority == 1?'selected':''}" />>优先</option>
									<option value="2"
										<c:out value="${work.priority == 2?'selected':''}" />>普通</option>
									<option value="3"
										<c:out value="${work.priority == 3?'selected':''}" />>置后</option>
									<option value="4"
										<c:out value="${work.priority == 4?'selected':''}" />>延迟</option>
							</select></td>
						</tr>
						<tr>
							<td>工作状态</td>
							<td><s:radio name="work.status"
									list="%{#{'0':'不活跃','1':'活跃'}}" id="status"
									onclick="return check()"></s:radio></td>
						</tr>
						<tr>
							<td>工作起始时间</td>
							<td><s:textfield name="work.startdate"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="startdate" />
							</td>
						</tr>
						<tr>
							<td>工作结束时间</td>
							<td><s:textfield name="work.deadline"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="deadline" />
							</td>
						</tr>
						<tr>
							<td>上传文件</td>
							<td><s:file name="image" label="请选择文件"></s:file></td>
						</tr>
						<tr>
							<td>工作负责人</td>
							<td><s:select list="work.list" listValue="name"
									listKey="userid" value="work.userid" name="userid"></s:select>
							<td>
						</tr>
						<tr>
							<td>工作量</td>
							<td><s:textfield name="work.workamount" id="workamount" />人·天</td>
						</tr>
						<tr>
							<td>上传文件</td>
							<td><s:file name="image" label="请选择文件"></s:file></td>
						</tr>
						<tr><td></td>
						<td> <a
								href="<s:url action="alertwork"><s:param name="work.userid" value="work.userid" /><s:param name="work.title" value="work.title" /></s:url>">发送提醒邮件</a>
						
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit"
								type="submit" class="button" value="确 认"
								onClick="return mycheck();" /></td>
						</tr>
						<tr>
							<td height="35" colspan="2" class="top_hui_text" align="center"
								colspan="2"><span class="errorAndmes"><s:actionerror
										cssStyle="font-family: Arial,Helvetica,sans-serif" /> </span></td>
						</tr>
						<tr>
							<td colspan="2" align="right"><a
								href="<s:url action="showallwork"><s:param name="work.wpid" value="work.wpid" /></s:url>">返回查看所有工作包</a>
							</td>
						</tr>
					</table></td>
				<td width="30%">&nbsp;</td>
			</tr>

		</table>
	</s:form>
</body>